let name:string = 'Yee'
let age:number  = 30
let sentence=`hello,my name is ${name}.
I'll be ${age+1} year old next month`



// 元祖
let x:[string,number]
x=['hello',10]
// x =[10,'hello']
// x[3]=1
//枚举类型
enum Color{
    Red = 1,
    Green = 2,
    Blue = 4
}
let c:Color=Color.Green
let colorNamme:string=Color[2]
console.log(colorNamme)
//nerver不存在类型
function error(message:string):nerver{
    throw new Error(message)
}
function fail(){
    return error('something failed')
}
function inifiniteLoop():never{
    while(true){

    }
}
//obj 类型
declare function create(o:object|null):void;

create(o:{prop:0})
create(o:null)

create(o:423)
create(o:'string')
create(o:false)
create(o:undefined)


let someValue:any='this is a string'
let strLength:number=(someValue as string).length